<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
	<meta name="viewport" content="width=device-width,initial-scale=1.0,maximum-scale=1.0,user-scalable=no">
    <title>芸香小筑</title>
    <style>
        *{margin:0; padding:0; box-sizing:border-box; font-family:"Microsoft YaHei"; text-align:center;}
        html,body{width:100%; height:100%; background-image:url(https://s1.ax1x.com/2020/04/11/G7UP7F.png);}
		.logo{margin:30px auto; height:100px; background-color:#fff; filter:alpha(Opacity=60);-moz-opacity:0.6;opacity:0.6;} 
        .pwd{font-size:36px; font-weight:bold; color:#fff;}
        .btn{display:block; margin:30px auto; width:60%; height:50px; font-size:20px; font-weight:bold; line-height:50px; color:#555; background:#eee; border-radius:10px; border:none;}
		.tip{color:#aaa;}
        .url{margin:30px auto;}
		.url a{font-size:20px; font-weight:bold; text-decoration:none; color:#fff;}
    </style>
	<script src="clipboard.min.js"></script>
</head>
<body>
    <div>
	    <div class="logo"><img src="https://s1.ax1x.com/2020/04/11/Gb93N9.png"></div>
		<div class="pwd" id="pwd"></div>
        <button class="btn" id="btn">一键复制提取码</button>
        <p class="tip">如果复制失败请手动输入提取码</p>
        <p class="url"><a id="url" href="">点击进入百度网盘 »</a></p>
		<script>
            function GetQueryString(name)
                {
                     var reg = new RegExp("(^|&)"+ name +"=([^&]*)(&|$)");
                     var r = window.location.search.substr(1).match(reg);
                     if(r!=null)return unescape(r[2]); return null;
                }
            document.getElementById("url").href = GetQueryString("url");
            document.getElementById("pwd").innerHTML = GetQueryString("pwd");

            var pwd = document.getElementById("pwd");
            var p = pwd.innerHTML;
            var clipboard = new ClipboardJS('.btn', {
                text: function() {
                    return p;
                }
            });

            clipboard.on('success', function(e) {
                btn.innerHTML='复制成功!';
            });

            clipboard.on('error', function(e) {
                btn.innerHTML='复制失败!';
            });
        </script>
    </div>
</body>
</html>